function K=Rand_NS(mu_K,sigma,NP,u_K)
    K=mu_K+sigma*tan(pi*(rand(1,NP)-1/2));
    index1=find(K>u_K);
    index2=find(K<2);
    [~,n1]=size(index1);
    [~,n2]=size(index2);
    while n1~=0||n2~=0
        if n1~=0
            K(index1)=mu_K+sigma*tan(pi*(rand(1,n1)-1/2));
        end
        if n2~=0
            K(index2)=mu_K+sigma*tan(pi*(rand(1,n2)-1/2));
        end
        index1=find(K>u_K);
        index2=find(K<2);
        [~,n1]=size(index1);
        [~,n2]=size(index2);
    end 
end